<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary
    
    x:Class="OpenLS.Chart.UI.AxisPropertiesResources" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:chart="http://schemas.Kherty.com/office/2007/chart"
    xmlns:chartui="clr-namespace:OpenLS.Chart.UI"
    xmlns:Internals="clr-namespace:OpenLS.Chart.UI.Internals">
    <ResourceDictionary.MergedDictionaries>
        <chartui:EnumResources/>
        <chartui:UnitResources/>
    </ResourceDictionary.MergedDictionaries>
    <DataTemplate DataType="{x:Type chart:Axis}">
        <TabControl TabStripPlacement="Left" chartui:ChartElement.ViewModel="{Binding Converter={x:Static Internals:ChartConverters.ViewModelFactory}}">
            <TabItem Header="{x:Static Internals:UIStringTable.AxisOptions}">
                <StackPanel>
                    <TextBlock Text="{x:Static Internals:UIStringTable.AxisOptions}"/>
                    <CheckBox IsChecked="{Binding Path=Orientation, Converter={x:Static Internals:ChartConverters.OrientationToBooleanConverter}}"
                              Content="{x:Static Internals:UIStringTable.InvertedValues}"/>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{x:Static Internals:UIStringTable.MajorTickMark}"></TextBlock>
                        <ComboBox Grid.Column="1" 
                                  ItemsSource="{Binding Source={x:Type chart:TickMark}, Converter={x:Static Internals:ChartConverters.EnumEnumerator}}"
                            SelectedItem="{Binding Path=MajorTickMark, Mode=TwoWay}" Style="{x:Static chartui:EnumResources.EnumComboBoxStyle}">
                        </ComboBox>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{x:Static Internals:UIStringTable.MinorTickMark}"></TextBlock>
                        <ComboBox Grid.Column="1" 
                                  ItemsSource="{Binding Source={x:Type chart:TickMark}, Converter={x:Static Internals:ChartConverters.EnumEnumerator}}"
                            SelectedItem="{Binding Path=MinorTickMark, Mode=TwoWay}" Style="{x:Static chartui:EnumResources.EnumComboBoxStyle}"/>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{x:Static Internals:UIStringTable.AxisLabels}"></TextBlock>
                        <ComboBox Grid.Column="1" 
                                  ItemsSource="{Binding Source={x:Type chart:TickLabelPosition}, Converter={x:Static Internals:ChartConverters.EnumEnumerator}}"
                            SelectedItem="{Binding Path=TickLabelPosition, Mode=TwoWay}" />
                    </Grid>
                </StackPanel>
            </TabItem>
            <TabItem Header="{x:Static Internals:UIStringTable.Fill}" >
                <ContentControl Content="{Binding Path=(chartui:ChartElement.ViewModel).FillFormatter, RelativeSource={RelativeSource Self}}" />

              <!--  <ContentControl Content="{Binding}" ContentTemplate="{x:Static chartui:ShapedPropertiesResources.FillPropertiesTemplate}"/> -->
            </TabItem>
            <TabItem Header="{x:Static Internals:UIStringTable.LineColor}">
                <ContentControl Content="{Binding Path=(chartui:ChartElement.ViewModel).LineFillFormatter, RelativeSource={RelativeSource Self}}" />
            </TabItem>
            <TabItem Header="{x:Static Internals:UIStringTable.LineStyle}">
                <ContentControl Content="{Binding Path=(chartui:ChartElement.ViewModel).LineStyleFormatter, RelativeSource={RelativeSource Self}}" />
            </TabItem>
        </TabControl>
        
    </DataTemplate>
    <DataTemplate DataType="{x:Type chart:ValueAxis}">
        <TabControl TabStripPlacement="Left" chartui:ChartElement.ViewModel="{Binding Converter={x:Static Internals:ChartConverters.ViewModelFactory}}">
            <TabItem Header="{x:Static Internals:UIStringTable.AxisOptions}">
                <StackPanel>
                    <TextBlock Text="{x:Static Internals:UIStringTable.AxisOptions}"/>
                    <CheckBox IsChecked="{Binding Path=Orientation, Converter={x:Static Internals:ChartConverters.OrientationToBooleanConverter}}"
                              Content="{x:Static Internals:UIStringTable.InvertedValues}"/>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Label Content="{x:Static Internals:UIStringTable.DisplayUnits}" />
                        <ComboBox SelectedItem="{Binding Path=DisplayUnits.Unit, Converter={x:Static Internals:ChartConverters.ForceUnitConverter}}" 
                                  ItemsSource="{x:Static chartui:UnitManager.BuiltInUnits}" Grid.Column="1" SelectionChanged="ComboBox_SelectionChanged"
                                  VerticalAlignment="Center">
                        </ComboBox> 
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{x:Static Internals:UIStringTable.MajorTickMark}"></TextBlock>
                        <ComboBox Grid.Column="1" 
                                  ItemsSource="{Binding Source={x:Type chart:TickMark}, Converter={x:Static Internals:ChartConverters.EnumEnumerator}}"
                            SelectedItem="{Binding Path=MajorTickMark, Mode=TwoWay}" Style="{x:Static chartui:EnumResources.EnumComboBoxStyle}"/>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{x:Static Internals:UIStringTable.MinorTickMark}"></TextBlock>
                        <ComboBox Grid.Column="1" 
                                  ItemsSource="{Binding Source={x:Type chart:TickMark}, Converter={x:Static Internals:ChartConverters.EnumEnumerator}}"
                            SelectedItem="{Binding Path=MinorTickMark, Mode=TwoWay}" Style="{x:Static chartui:EnumResources.EnumComboBoxStyle}"/>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{x:Static Internals:UIStringTable.AxisLabels}"></TextBlock>
                        <ComboBox Grid.Column="1" 
                                  ItemsSource="{Binding Source={x:Type chart:TickLabelPosition}, Converter={x:Static Internals:ChartConverters.EnumEnumerator}}"
                            SelectedItem="{Binding Path=TickLabelPosition, Mode=TwoWay}" />
                    </Grid>
                </StackPanel>
            </TabItem>
            <TabItem Header="{x:Static Internals:UIStringTable.Fill}">
                <!-- <ContentControl Content="{Binding}" ContentTemplate="{x:Static chartui:ShapedPropertiesResources.FillPropertiesTemplate}"/> -->
                <ContentControl Content="{Binding Path=(chartui:ChartElement.ViewModel).FillFormatter, RelativeSource={RelativeSource Self}}" />

            </TabItem>
            <TabItem Header="{x:Static Internals:UIStringTable.LineColor}">
              <!--  <ContentControl Content="{Binding}" ContentTemplate="{x:Static chartui:ShapedPropertiesResources.LineFillPropertiesTemplate}"/> -->
                <ContentControl Content="{Binding Path=(chartui:ChartElement.ViewModel).LineFillFormatter, RelativeSource={RelativeSource Self}}" />

            </TabItem>
            <TabItem Header="{x:Static Internals:UIStringTable.LineStyle}">
                <ContentControl Content="{Binding Path=(chartui:ChartElement.ViewModel).LineStyleFormatter, RelativeSource={RelativeSource Self}}" />
            </TabItem>
        </TabControl>

    </DataTemplate>

</ResourceDictionary>